/*
Copyright (C) 2012 Brady Vidovic

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ftr.tools;

import btv.logger.BTVLogLevel;
import btv.logger.BTVLoggerOptions;
import btv.tools.BTVConstants;
import java.io.File;

/**
 *
 * @author bvidovic
 */
public class Constants extends BTVConstants{
    
    /**
     * Single Instance constructor.. 
     * If singleInstance is true, limits to single instance of this program, based on binding to singleInstancePort
     * @param propertiesFileName The name of the properties file in the base dir
     * @param singleInstance Set to true to limit to single instance
     * @param singleInstancePort Port to bind to 
     * @param singleInstanceTimeoutSec Seconds to wait for other instance to finish before proceeding. <0 means wait forever
     */
    public Constants(String propertiesFileName, BTVLogLevel logLevel, boolean singleInstance, int singleInstancePort, int singleInstanceTimeoutSec)
    {
        super(Constants.class, 
                new BTVLoggerOptions()
                .setSingleInstance(singleInstance, singleInstancePort, singleInstanceTimeoutSec)
                .setLevelToLogAt(logLevel)
                .setLogToCurrentFile(true)
                .setLogToHistoryFile(true)
                .setLogToMemory(true)
                .setLogToSystemOut(true));        
                
        if(TESTING)
        {
            BASE_DIR = BASE_DIR.getParentFile();
            Logger.INFO("TESTING = "+TESTING+", BASE_DIR is now: "+ BASE_DIR.getAbsolutePath());
        }
        
        //load config            
        Config = new Config(new File(BASE_DIR, propertiesFileName));
        
        //over-ride any super static variables here
        //ENCODING_FORMAT="xxx";
    }
    
    //static final
    public static final String PROGRAM_NAME ="ForTheLibrary";
    public static final String PROGRAM_VERSION = "1.1.1";//Version of this release
    public static final String SUPPORTED_FTR_VERSION = "1.6.0.2 and 1.7.0.0";//tested on this version        
    public static final String TV_SHOWS_DIR = "_TV Shows";//currently not configurable
    public static final String MOVIES_DIR = "_Movies";//currently not configurable
    public static final String FTR_MOVIE_CATEGORY = "Movies";//"Movies" is 4tr category name for films
    public static final String XBMC_EXCLUDE_TV_SHOW_IDENTIFIER = ".sample";//Anything that matches regex: [!-._ \\/]sample[-._ \\/]
    
    
    //static defaults
    public static Config Config = null;
    
        
}